package com.songshuai.sales.tool.feign;


import com.songshuai.sales.tool.config.MultipartSupportConfig;
import com.songshuai.webapi.baseapi.dto.feign.response.phpsop.SopDto;
import com.songshuai.webapi.baseapi.dto.feign.response.phpsop.SopTypeDto;
import com.songshuai.webapi.baseapi.dto.feign.response.sopmanage.CustomerListResDto;
import com.songshuai.webapi.baseapi.dto.pangu.request.phpsop.PhpSopReqDto;
import com.songshuai.webapi.baseapi.pojo.QueryPageRes;
import com.songshuai.webapi.baseapi.pojo.QueryRes;
import com.songshuai.webapi.baseapi.pojo.QueryResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;


@FeignClient(name = "pangu-api",configuration = MultipartSupportConfig.class)
public interface PanguApiClient {

    // 根据userId获取维护的客户
    @GetMapping(value = "/api/back/customer/customerList")
    QueryRes<QueryPageRes<List<CustomerListResDto>>> getCustomerListByUserId(@RequestParam("userId") String userId,
                                                                                 @RequestParam("bindStatus") Integer bindStatus,
                                                                                 @RequestParam("customerStatus") Integer customerStatus,
                                                                                 @RequestParam("pageIndex") Integer pageIndex,
                                                                                 @RequestParam("pageSize") Integer pageSize);
    //上传图片
    @PostMapping(value ="/api/common/uploadPictureSop",consumes = MediaType.MULTIPART_FORM_DATA_VALUE,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    QueryRes uploadPictureSop(@RequestPart("file") MultipartFile file, @RequestParam("imgMaxSize") Integer imgMaxSize,
                           @RequestParam("basePath") String basePath, @RequestParam("imgPath") String imgPath);

    //sop分类列表
    @GetMapping(value ="/api/back/php/sop/typeList")
    QueryResponse<List<SopTypeDto>> getPhpSopTypeList(@RequestParam("type") String type);

    //sop内容列表
    @PostMapping(value ="/api/back/php/sop/sopList")
    QueryResponse<QueryPageRes<List<SopDto>>> getPhpSopList(@RequestBody PhpSopReqDto phpSopReqDto);

    //sop内容详情
    @GetMapping(value ="/api/back/php/sop/sopDetail")
    QueryResponse<SopDto> getPhpSopDetail(@RequestParam("id") String id);

}



